/**
 * @properties={typeid:35,uuid:"D1E899BE-FCFA-45FA-A770-03D283274D1A",variableType:4}
 */
var fControl = 0;

/**
 * @properties={typeid:35,uuid:"2A889A75-2141-4ACC-8B08-BA718B1F83A2"}
 */
var fPass1 = null;

/**
 * @properties={typeid:35,uuid:"F703C048-E64E-4244-82A4-EF1899CD8AE9"}
 */
var fPass2 = null;

/**
 * @properties={typeid:24,uuid:"F8F3D027-2F7E-4B9D-8905-87BA63624424"}
 */
function cambiarPass(event) {
	if(fPass1 == fPass2)
	{
		var p = globals.hashPass(fPass1)
		hash_pass = p
		cambiarPassServoy(fPass1)
		fPass1 = null
		fPass2 = null
		databaseManager.saveData()
		fControl = 1
		application.closeFormDialog('Cambio')
	}
	else
	{
		fPass1 = null
		fPass2 = null
		globals.gDialog('Error','Verificacion de contraseña fallo','OK','CerrarForm')
	}
}

/**
 * @properties={typeid:24,uuid:"683365A4-CB15-4CEB-A853-4EE8A462E751"}
 */
function cambiarPassServoy(pass)
{
	var id = security.getUserUID(usuario)
	security.setPassword(id, pass)
}

/**
 * Handle hide window.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"623E8BF5-9448-453A-9A38-86F9CA0BAB47"}
 */
function onHide(event) {
	if (fControl == 1)
	{
		fControl = 0
		return true
	}
	return false
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"50FD707B-E795-4F60-8499-71089F9EAA3F"}
 */
function cancelar(event) {
	fControl = 1
	application.closeFormDialog('Cambio')
}
